{% include 'op_header.html' %}
<script type="text/javascript" charset="utf-8">
    window.UEDITOR_HOME_URL = "/static/js/ueditor/";
</script>

<script type="text/javascript" charset="utf-8" src="/static/js/ueditor/editor_config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/js/ueditor/editor_all_min.js"></script>
<link rel="stylesheet" type="text/css" href="/static/js/ueditor/themes/default/ueditor.css"/>


			<form class="form-horizontal" method="post">
                <div class="voilet_left">
{#                 {%csrf_token%}#}
				<div class="control-group">
					 <label class="control-label" for="name">姓名</label>
					<div class="controls">
                        {{ user_edit.user_name }}
					</div>
				</div>
                <div class="control-group">
					 <label class="control-label" for="name">故障类型</label>
					<div class="controls">
						{{ user_edit.fault_type }}
					</div>
				</div>
                <div class="control-group">
					 <label class="control-label" for="name">报障来源</label>
					<div class="controls">
						{{ user_edit.Source }}
					</div>
				</div>
                <div class="control-group">
					 <label class="control-label" for="name">故障描述</label>
					<div class="controls">
						{{ user_edit.title }}
					</div>
				</div>
                <div class="control-group">
					 <label class="control-label" for="name">发生时间</label>
					<div class="controls">
						<input name="Occur_date" id="id_Occur_date" value = "{{ user_edit.Occur_date|safe }}"  type="text" />
					</div>
				</div>
                <div class="control-group">
					 <label class="control-label" for="name">发现时间</label>
					<div class="controls">
						<input name="Discovery_date" id="id_Discovery_date" value = "{{ user_edit.Discovery_date|safe }}" type="text" />
					</div>
				</div>
                <div class="control-group">
					 <label class="control-label" for="name">解决时间</label>
					<div class="controls">
						<input name="Solve_date" id="id_Solve_date" value = "{{ user_edit.Solve_date|safe }}"  type="text" />
					</div>
				</div>
                </div>
                <div class="voilet_right">
                <div class="control-group">
					 <label class="control-label"  for="name">处理过程分析</label>
					<div class="controls">
{#						<input name="content" style="height:200px;width:400px" id="id_content" type="text" />#}
                        <textarea id="editor" name="content" style="width:600px;height:500px;">{{ user_edit.content }}</textarea>
{#                        {{article.content}}#}
					</div>
				</div>
{#                <div class="control-group">#}
{#					 <label class="control-label" for="name">上传图片</label>#}
{#					<div class="controls">#}
{#						<input type="file" name="headImg" id="id_headImg" />#}
{#					</div>#}
{#				</div>#}
{#                {{ uf.as_p }}#}
                </div>
                <div class="clear"></div>
				<div class="control-group">
					<div class="controls">
						 <button type="submit" class="btn">提交</button>
					</div>
				</div>

			</form>

{#<div class="details">#}
{#    <div>#}
{#        <form action="/ueditor" method="post">#}
{#            {%csrf_token%}#}
{#            <textarea id="editor" name="editor" style="width:600px;height:500px;">{{article.content}}</textarea>#}
{#            <input type="button" value="javascript 测试" onclick="testueditor();"/>#}
{#            <input type="button" value="插入内容" onclick="insertueditor();"/>#}
{#        </form>#}
{#    </div>#}
{#</div>#}


		</div>
	</div>
</div>


{#感谢秋实同学提供js代码#}


<script type="text/javascript">
    function calBegin(cal)
    {
        var date = cal.date;
        var field = document.getElementById("id_Occur_date");
        field.value = date.print("%Y-%m-%d %H:%M:%S");
    }
    Calendar.setup
    ({
        inputField		: "id_Occur_date",
        ifFormat		: "%Y-%m-%d %H:%M:%S",
        showsTime	: true,
        onUpdate		: calBegin
    });

    function calEnd(cal)
    {
        var date = cal.date;
        var field = document.getElementById("id_Discovery_date");
        field.value = date.print("%Y-%m-%d %H:%M:%S");
    }
    Calendar.setup
    ({
        inputField		: "id_Discovery_date",
        ifFormat		: "%Y-%m-%d %H:%M:%S",
        showsTime	: true,
        onUpdate		: calEnd
    });
    function calclose(cal)
    {
        var date = cal.date;
        var field = document.getElementById("id_Solve_date");
        field.value = date.print("%Y-%m-%d %H:%M:%S");
    }
    Calendar.setup
    ({
        inputField		: "id_Solve_date",
        ifFormat		: "%Y-%m-%d %H:%M:%S",
        showsTime	: true,
        onUpdate		: calclose
    });
</script>

{#end#}

{#编缉器JS#}
<script type="text/javascript">
    var ue=new UE.ui.Editor();
    ue.render('editor');
    ue.addListener("selectionchange",function(){
        var state = ue.queryCommandState("source");
        var btndiv = document.getElementById("btns");
        if(btndiv){
            if(state){
                btndiv.style.display = "none";
            }else{
                btndiv.style.display = "";
            }
        }

    });
    function getContent(){
        var arr = [];
        arr.push("使用editor.getContent()方法可以获得编辑器的内容");
        arr.push("内容为：");
        arr.push(ue.getContent());
        alert(arr.join("\n"));
    }
    function getPlainTxt(){
        var arr = [];
        arr.push("使用editor.getPlainTxt()方法可以获得编辑器的带格式的纯文本内容");
        arr.push("内容为：");
        arr.push(ue.getPlainTxt());
        alert(arr.join('\n'))
    }
    function setContent(){
        var arr = [];
        arr.push("使用editor.setContent('欢迎使用ueditor')方法可以设置编辑器的内容");
        ue.setContent('欢迎使用ueditor');
        alert(arr.join("\n"));
    }

    function getText(){
        //当你点击按钮时编辑区域已经失去了焦点，如果直接用getText将不会得到内容，所以要在选回来，然后取得内容
        var range = ue.selection.getRange();
        range.select();
        var txt = ue.selection.getText();
        alert(txt)
    }

    function testueditor(){
    	mycontent=ue.getContentTxt();
    	alert(mycontent);
    }

    function insertueditor(){
    	ue.execCommand('insertHtml',"自定义插件，我的名片	");
    }

    function getContentTxt(){
        var arr = [];
        arr.push("使用editor.getContentTxt()方法可以获得编辑器的纯文本内容");
        arr.push("编辑器的纯文本内容为：");
        arr.push(ue.getContentTxt());
        alert(arr.join("\n"));
    }
    function hasContent(){
        var arr = [];
        arr.push("使用editor.hasContents()方法判断编辑器里是否有内容");
        arr.push("判断结果为：");
        arr.push(ue.hasContents());
        alert(arr.join("\n"));
    }
    function setFocus(){
        ue.focus();

    }
    function deleteEditor(){
        var div = document.getElementById('allbtn');
        var btns = baidu.editor.dom.domUtils.getElementsByTagName(div,"a");
        for(var i=0,btn;btn=btns[i++];){
		    btn.style.cssText = "color:#ccc;text-decoration:none;cursor:default";
            btn.onclick = function(){
                return false;
            };
        }
        ue.destroy();
    }
	function setEnabled(){
	    var div = document.getElementById('allbtn');
        var btns = baidu.editor.dom.domUtils.getElementsByTagName(div,"a");
        for(var i=0,btn;btn=btns[i++];){
			btn.style.cssText = "color:#3E3E3E;text-decoration:none;cursor:pointer";
        }
	    ue.setEnabled();
	}
	function setDisable(){
	    var div = document.getElementById('allbtn');
        var btns = baidu.editor.dom.domUtils.getElementsByTagName(div,"a");
        for(var i=0,btn;btn=btns[i++];){
		    if(btn.innerHTML != "可以编辑"){
				btn.style.cssText = "color:#ccc;text-decoration:none;cursor:default";
			}
        }
	    ue.setDisabled("fullscreen");
	}

</script>

<!-- baidu ueditor end -->



{% include 'op_bottom.html' %}